package com.zhuangjie.order.feign;

import com.zhaungjie.base.conduit.TypeR;
import com.zhuangjie.rider.dto.CreateDeliveryOrderDTO;
import com.zhuangjie.rider.dto.RiderEvaluateDTO;
import com.zhuangjie.rider.vo.DeliveryOrderForUserOrderMapVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

@Component
@FeignClient(name = "spark-rider",path = "/rider")
public interface RiderFeignService {

    @PostMapping("/delivery-order/submit")
    TypeR<Void> submit(@RequestBody CreateDeliveryOrderDTO createDeliveryOrderDTO);

    @ApiOperation("创建店铺订单入账记录")
    @PostMapping("/rider-order-accounting-record/order-accounting/{orderId}")
    TypeR<Void> createOrderAccounting(@PathVariable("orderId") Long orderId);

    @GetMapping("/delivery-order/delivery-info-for-user-order-map/{orderId}")
    @ApiOperation("获取配送信息")
    TypeR<DeliveryOrderForUserOrderMapVO> deliveryInfoForUserOrderMap(@PathVariable("orderId") Long orderId);

    @ApiOperation("子评价-评价提交到骑手")
    @PostMapping("/rider-evaluate/submit")
    TypeR<Void> submitRiderEvaluate(@Valid @RequestBody RiderEvaluateDTO riderEvaluateDTO);
}
